from PIL import Image

image = Image.open("example.jpg")

# 获取图像格式
print("Format:", image.format)  # 输出: JPEG, PNG 等

# 获取图像尺寸
print("Size:", image.size)  # 输出: (width, height)

# 获取图像模式
print("Mode:", image.mode)  # 输出: RGB, L, RGBA 等